/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cip.esymons.general.bc;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.cip.esymons.general.be.Permiso;

/**
 *
 * @author Lizardo Rios
 */
@Stateless
public class PermisoFacade implements PermisoFacadeLocal {

    @PersistenceContext
    private EntityManager em;

    public void create(Permiso permiso) {
        em.persist(permiso);
    }

    public void edit(Permiso permiso) {
        em.merge(permiso);
    }

    public void remove(Permiso permiso) {
        em.remove(em.merge(permiso));
    }

    public Permiso find(Object id) {
        return em.find(Permiso.class, id);
    }

    public List<Permiso> findAll() {
        return em.createQuery("select p from Permiso p").getResultList();
    }

    
}
